//
//  EKCellModelsManager.h
//  Eakay
//
//  Created by zach on 2018/12/13.
//  Copyright © 2018年 恒天易开软件科技股份有限公司. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "EKCellModelProtocol.h"

NS_ASSUME_NONNULL_BEGIN

typedef void(^ConfigureCellBlock)(UITableViewCell *cell, id<EKCellModelProtocol> item);

@interface EKTableDataSource : NSObject <UITableViewDataSource>
/** TableViewDataSource */
@property (nonatomic, copy) ConfigureCellBlock configureCellBlock;

- (void)addItems:(NSArray <id<EKCellModelProtocol>>*)items; // default section 0.
- (void)addItems:(NSArray <id<EKCellModelProtocol>>*)items atSection:(NSInteger)section;
- (void)addItem:(id<EKCellModelProtocol>)item atSection:(NSInteger)section;
- (void)addItem:(id<EKCellModelProtocol>)item atIndexPath:(NSIndexPath *)indexPath;

- (id<EKCellModelProtocol>)itemForIndexPath:(NSIndexPath *)indexPath;
- (NSIndexPath *)indexPathForItem:(id<EKCellModelProtocol>)item;

/** TableView DataSource配置方法 */
- (void)configureCellBlock:(ConfigureCellBlock)configureCell;

@end

NS_ASSUME_NONNULL_END
